/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dawnland03.model.entity;

import dawnland03.model.entity.attribute.PhysicalAttribute;
import dawnland03.model.entity.attribute.Position;
import dawnland03.model.item.ItemType;
import java.util.HashMap;
import java.util.Map;

/**
 * This class is used by an action, to send the state of the entity from the moment when an action ended.
 *
 * @author Petru Obreja (obrejap@yahoo.com)
 */
public class EntitySnapshot {
    private final Integer id;
    private final Integer x;
    private final Integer y;
    private final Integer matrixCellId;
    private final Map<PhysicalAttribute, Double> physicalAttributes;
    private final Map<ItemType, Integer> items;

    public EntitySnapshot(Integer id,
            Integer x, Integer y, Integer matrixCellId,
            Map<PhysicalAttribute, Double> physicalAttributes,
            Map<ItemType, Integer> items) {
        this.id = id;
        this.x = x;
        this.y = y;
        this.matrixCellId = matrixCellId;
        this.physicalAttributes = physicalAttributes;
        this.items = items;
    }

    public Integer getId() {
        return id;
    }

    public Double getPhysicalAttribute(PhysicalAttribute physicalAttribute) {
        return physicalAttributes.get(physicalAttribute);
    }

    public Map<PhysicalAttribute, Double> getPhysicalAttributes() {
        return physicalAttributes;
    }

    public Map<ItemType, Integer> getItems() {
        return items;
    }

    public Integer getX() {
        return x;
    }

    public Integer getY() {
        return y;
    }

    public Integer getMatrixCellId() {
        return matrixCellId;
    }

}
